send

suspend fun send(recipient: Recipient, messageBody: String, timestamp: Long = Clock.System.now().toEpochMilliseconds(), attachments: Collection<JsonAttachment> = emptyList(), quote: JsonQuote? = null, mentions: Collection<JsonMention> = emptyList(), previews: Collection<JsonPreview> = emptyList()): SendResponse

Sends a message to either a single user (Recipient.Individual) or a group (Recipient.Group).

Parameters

recipient

The recipient that will receive our message. If sending to a group, note that signald will handle the fan-out of messages to all users.

messageBody

The body of the message.

timestamp

The timestamp of the message that we are sending. Default to the current system clock time.

attachments

Attachments to include in the message.

quote

A quote to include in the message, where the quote refers to a previous message.

mentions

Mentions to include in the message. Typically, an empty space is used as the mention placeholder, and then the position of the empty space is referred to by the JsonMention.start property.

previews

Link previews to include in the message.

Throws